<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  let arr = ['houdunren', 2020]
  let [name, year] = arr;
  console.log(name, year);

  let [userName, ...args] = ['wzy', 'hello', 'world']
  console.log(userName)
  console.log(args)
  /*总结 : ... 放到变量位置就是吸收，放到值位置就是打散*/

  //输出 haha,hello,world的数组
  console.log('haha', ...args)

  //  设置默认值
  let [k, v = 22] = ["11*2"]
  console.log(v)


</script>
</body>
</html>